package main

import (
	"sync"
	"time"
)

// 并发
func main() {
	wg := sync.WaitGroup{}
	wg.Add(2)
	go func() {
		println("等待30s")
		time.Sleep(30 * time.Second)
		wg.Done()
	}()
	go func() {
		println("等待10s")
		time.Sleep(10 * time.Second)
		wg.Done()
	}()
	wg.Wait()
	println("等待结束")
}
